package com.care.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="consult")
public class Consult {
	private int id;
	private String content;//咨询的问题
	private double money;
	private String type;//病型
	private boolean patient;//判断是否有病
	private String answer;//医生回答问题
	private User user;//与用户的对应关系
	private Doctor doctor;//与医生对应的关系
	public Consult(){
		
	}
	public Consult(String content, String type, User user) {
		super();
		this.content = content;
		this.type = type;
		this.user = user;
	}

	public Consult(int id, String content, double money, String type, boolean patient, String answer, User user,
			Doctor doctor) {
		super();
		this.id = id;
		this.content = content;
		this.money = money;
		this.type = type;
		this.patient = patient;
		this.answer = answer;
		this.user = user;
		this.doctor = doctor;
	}



	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	@Column(name="content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	@Column(name="type")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	@Column(name="patient")
	public boolean isPatient() {
		return patient;
	}

	public void setPatient(boolean patient) {
		this.patient = patient;
	}
	@Column(name="answer")
	public String getAnswer() {
		return answer;
	}
	public void setAnswer(String answer) {
		this.answer = answer;
	}
	@Column(name="money")
	public double getMoney() {
		return money;
	}
	public void setMoney(double money) {
		this.money = money;
	}

	
	@ManyToOne()
    @JoinColumn(name="uc")
	public User getUser() {
		return user;
	}
	
	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne()
    @JoinColumn(name="dc")
	public Doctor getDoctor() {
		return doctor;
	}


	public void setDoctor(Doctor doctor) {
		this.doctor = doctor;
	}


	@Override
	public String toString() {
		return "Consult [id=" + id + ", content=" + content + ", money=" + money + ", type=" + type + ", patient="
				+ patient + ", answer=" + answer + ", user=" + user + ", doctor=" + doctor + "]";
	}




	
}
